<template>
  <div>
    <div class="title">猜你喜欢</div>
    <ul>
      <router-link 
        tag="li" 
        class="item border-bottom"
        v-for="item in recommendListReal" 
        :key="item.id"
        :to="'/detail/' + item.id">
        <img class="item-img" :src="item.imgUrl"/>
        <div class="item-info">
          <p class="item-title">{{item.title}}</p>
          <p class="item-desc">{{item.desc}}</p>
          <button class="item-button">查看详情</button>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: "homeRecommend",
  props: {
    recommendListReal: Array
  },
  data () {
    return {
      recommendList: [{
        id: '1',
        imgUrl: 'http://img1.qunarzz.com/sight/p0/201402/20/d5c7da32877d8b90dc6297e491a4590e.jpg_200x200_49be5ab2.jpg',
        title: '重庆市人民大礼堂',
        desc: '继北京故宫后的精美奇巧的东方建筑'
      }, {
        id: '2',
        imgUrl: 'http://img1.qunarzz.com/sight/p0/1507/8d/8d1817185ad3f395.img.jpg_200x200_7971dc7e.jpg',
        title: '武隆天生三桥风景区',
        desc: '近期小伙伴们收藏最！多！的景点😊'
      }, {
        id: '3',
        imgUrl: 'http://img1.qunarzz.com/sight/p0/2001/3d/3d76914a6c5df3c9a3.img.jpg_200x200_0309931d.jpg',
        title: '乌江画廊',
        desc: '“千里乌江，百里画廊”'
      }]
    }
  }
}
</script>

<style lang="stylus" scoped>
  .title
    margin-top: .2rem
    line-height: .8rem
    background: #eee
    text-indent: .2rem
  .item
    overflow: hidden
    display: flex
    height: 1.9rem
    .item-img
      width: 1.7rem
      height: 1.7rem
      padding: .1rem
    .item-info
      flex: 1
      padding: .1rem
      .item-title
        line-height: .54rem
        font-size: .32rem
      .item-desc
        line-height: .4rem
        color: #aaa
        width: 95%
        overflow: hidden
        white-space: nowrap
        text-overflow: ellipsis
      .item-button
        line-height: .44rem
        margin-top: .16rem
        background: #ff9300
        padding: 0 .2rem
        border-radius: .06rem
        color: #fff
</style>
